home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / cbm / 4639 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.2 KB

  1. Path: news.iastate.edu!deaven
  2. From: deaven@ishmael.ameslab.gov (David Deaven)
  3. Newsgroups: comp.sys.cbm,gnu.gcc.help,comp.sys.atari.8bit
  4. Subject: Re: GNU C-compiler port to 6502
  5. Date: 27 Mar 1996 15:20:47 GMT
  6. Organization: Ames Laboratory, Ames, Iowa
  7. Message-ID: <4jbmcf$733@news.iastate.edu>
  8. References: <4irqpb$7pc@esel.cosy.sbg.ac.at>
  9. NNTP-Posting-Host: ishmael.ameslab.gov
  10.  
  11. In article <4irqpb$7pc@esel.cosy.sbg.ac.at>,
  12. Gerhard Wesp <gwesp@cosy.sbg.ac.at> wrote:
  13. >Is anybody out there by chance working on a gcc port to the 6502?
  14. >I have found an _lcc_ port, but that seems to produce rather poor assembly
  15. >for certain C code sequences.
  16. > I would maybe try to port gcc myself, but only if there are volunteers
  17. >to assist me ;-)
  18.  
  19.   Yes, I worked a bit on this.  What I currently have is not fully
  20. functional but implements most of the things required for a full
  21. ANSI compiler.  I never anticipated anything but a cross compiler,
  22. using my workstation to compile code for my herd of Ataris.
  23.  
  24.   Note that there are some choices to be made about whether an
  25. ``int'' should be 8, 16, or 32 bits long.  ANSI requires at least 16,
  26. and most programmers assume 32.  (Before anybody asks, GCC allows you
  27. to specify any size for all of the basic data types.  It is very
  28. flexible.)   More choices for floating point format (I used a switch
  29. to select Atari 48 bit with assumed AtariOS math functions, or 32/64
  30. bit with assembler macros that you'd have to supply).
  31.  
  32.   But the biggest choice of all is whether to let GCC manage the 6502
  33. registers directly, or to use a sort of ``virtual machine'' model on
  34. the 6502 that looks better to GCC (page zero registers, manipulated by
  35. simple bits of native code that GCC thinks are single instructions).
  36. I tried the former, and it was truly amusing to see GCC try to figure
  37. out how to evaluate complicated expressions using only those 8 bit
  38. regs.  The code was awful!  So I think the second route is better.
  39.  
  40.   I'd be willing to help out with this, though my time is limited.
  41. Perhaps we can get a list of folks together and discuss the basic
  42. design goals.
  43.  
  44. Dave
  45. -- 
  46. David Deaven        deaven@ishmael.ameslab.gov
  47. A504 Physics        tel 515-294-6878
  48. Ames Laboratory     fax 515-294-0689
  49. Ames IA 50011       http://www.public.iastate.edu/~deaven
  50.